package net.sxnic.ugr.context;

import net.sxnic.ugr.user.User;

/**
 * User Context Holder
 *
 * @version $Revision$
 * @author 曹浩
 */
public class UserContextHolder {

    private static ThreadLocal<User> userContextHolder = new ThreadLocal<User>();

    /**
     * 设置用户对象
     *
     * @param user 用户对象
     */
    public static void setUser(User user) {
        userContextHolder.set(user);
    }
    
    /**
     * 获取用户对象
     *
     * @return 用户对象
     */
    public static User getUser() {
        return userContextHolder.get();
    }

   
}
